<?php

class UserBase extends CActiveRecord
{
	/**
	 * The followings are the available columns in table 'users':
	 * @var double $Id
	 * @var string $Username
	 * @var string $Password
	 * @var string $FirstName
	 * @var string $LastName
	 * @var string $Email
	 * @var string $CreatedDate
	 * @var string $LastLogin
	 * @var string $ValidationCode
	 * @var integer $ValidationType
	 * @var integer $ValidationExpired
	 * @var integer $Status
	 */

	/**
	 * Returns the static model of the specified AR class.
	 * @return CActiveRecord the static model class
	 */
	public static function model($className='User')
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'users';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('Username, Password, FirstName, LastName, Email, CreatedDate', 'required'),
			array('ValidationType, ValidationExpired, Status', 'numerical', 'integerOnly'=>true),
			array('Username, Email', 'length', 'max'=>80),
			array('Password, FirstName, LastName', 'length', 'max'=>32),
			array('ValidationCode', 'length', 'max'=>64),
			array('LastLogin', 'safe'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'Id' => 'Id',
			'Username' => 'Username',
			'Password' => 'Password',
			'FirstName' => 'First Name',
			'LastName' => 'Last Name',
			'Email' => 'Email',
			'CreatedDate' => 'Created Date',
			'LastLogin' => 'Last Login',
			'ValidationCode' => 'Validation Code',
			'ValidationType' => 'Validation Type',
			'ValidationExpired' => 'Validation Expired',
			'Status' => 'Status',
		);
	}
}